import { t } from '@src/locales'

// 高级搜索
export const getAdvancedFields = (vm) => {
  let that = vm;
  return [
    {
      id: 5460,
      tableName: "customer",
      isSystem: 1,
      fieldName: "tags",
      displayName: t('common.label.belongsToDepartment'),
      formType: "select",
      defaultValue: null,
      isNull: 1,
      isSearch: 1,
      show: true,
      placeHolder: null,
      setting: {
        isMultiFlag: true
      },
      orderId: 1,
      isDelete: 0,
      guideProfessions: [],
      isGuideData: false,
      guideData: false,
      originalFormType: "select",
      operator: "eq",
      // isNothing: true,
    },
    {
      fieldName: 'roleIds',
      displayName: t('common.label.role'),
      formType: 'select',
      isNull: 1,
      isSystem: 1,
      operator: 'between',
      orderId: 2,
      isDelete: 0,
      setting: {
        isMulti: true,
        isMultiFlag: true,
        dataSource: that.rolesList || []
      }
    },
    {
      fieldName: 'enabled',
      displayName: t('common.label.status'),
      formType: 'select',
      isNull: 1,
      isSystem: 1,
      operator: 'between',
      orderId: 3,
      setting: {
        isMulti: false, 
        dataSource: [
          {
            text: t('common.base.all'),
            value: ""
          },
          {
            text: t('common.base.enable'),
            value: '1'
          },
          {
            text: t('common.base.deactivate'),
            value: '0'
          }
        ]
      }
    },
    {
      fieldName: 'labelIds',
      displayName: t('common.label.tag'),
      formType: 'select',
      isNull: 1,
      isSystem: 1,
      operator: 'between',
      orderId: 4,
      setting: {
        isMulti: true, 
        isMultiFlag: true,
        dataSource: that.baseLaberlList || []
      }
    }
  ].map(item => {
    return {
      ...item,
      defaultValue: null,
      show: true,
      visable: typeof item.visable == 'undefined' ? true : item.visable,
      isSearch: 1
    }
  });
}